export default {
    randomNumber(min, max){ // 随机数函数
        return ~~(min+Math.random()*(max - min + 1))
    },
    homeData(){ // home页面假数据生成函数
        const arr1 = []
        for (let i = 0; i < 6; i++) {
            const obj = {
                '张飞': this.randomNumber(10, 100),
                '赵云': this.randomNumber(10, 100),
                '曹操': this.randomNumber(10, 100),
                '黄忠': this.randomNumber(10, 100),
                '刘备': this.randomNumber(10, 100),
                '李逵': this.randomNumber(10, 100),
            }
            arr1.push(obj)
        }

        const weekData = ['月曜日','火曜日','水曜日','木曜日','金曜日','土曜日','日曜日']
        const arr2 = []
        for (let i = 0; i < 7; i++) {
            const obj = {
                date: weekData[i],
                new: this.randomNumber(10, 100),
                active: this.randomNumber(0, 100)*10
            }
            arr2.push(obj)
        }

        return {
            arr1,
            arr2
        }
    },
}